package com.fc.hkx.api;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fc.hkx.common.ResponseJson;
import com.fc.hkx.dto.FoodDto;
import com.fc.hkx.thirdparty.airchina.AirChinaApiService;
import com.fc.hkx.thirdparty.airchina.FlightDto;
import com.fc.hkx.thirdparty.airchina.FlightInfomation;
import com.fc.hkx.thirdparty.feiyou.FeiyouApiService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by charles on 2017/9/8.
 */
@RestController
@RequestMapping("/api/food")
@Api("Food  api")
public class FoodController {

    private ObjectMapper jsonMapper = new ObjectMapper();

    @RequestMapping("/list")
    public ResponseJson getFoodList(@RequestParam Map<String, String> params) throws Exception {
        ResponseJson responseJson = new ResponseJson();
        List<FoodDto> foods = new ArrayList<FoodDto>();
        FoodDto foodDto1 = new FoodDto();
        foodDto1.setName("普罗斯旺餐厅");
        foodDto1.setPrice("588");
        foodDto1.setImage("quanjude.jpg");

        foods.add(foodDto1);
        FoodDto foodDto = new FoodDto();
        foodDto.setName("全聚德");
        foodDto.setPrice("288");
        foodDto.setImage("quanjude.jpg");
        foods.add(foodDto);
        responseJson.setObj(foods);
        return responseJson;
    }
}
